home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / tde40.zip / global.h < prev    next >
Text File  |  1994-06-05  |  30KB  |  439 lines

  1. /*******************  start of original comments  ********************/
  2. /*
  3.  * Written by Douglas Thomson (1989/1990)
  4.  *
  5.  * This source code is released into the public domain.
  6.  */
  7. /*********************  end of original comments   ********************/
  8.  
  9. /*
  10.  * New editor name:  TDE, the Thomson-Davis Editor.
  11.  * Author:           Frank Davis
  12.  * Date:             June 5, 1991
  13.  *
  14.  * This modification of Douglas Thomson's code is released into the
  15.  * public domain, Frank Davis.  You may distribute it freely.
  16.  *
  17.  * See "tdestr.h" for a description of these variables. C requires global
  18.  *  variables to be declared "extern" in all modules except one.  This file
  19.  *  is included in ed.c and it should not be included in any other module.
  20.  */
  21. BUFFERS g_buff;
  22.  
  23. displays g_display;
  24.  
  25. status_infos g_status;
  26.  
  27. boyer_moore_type bm;
  28.  
  29. boyer_moore_type sas_bm;
  30.  
  31. CEH ceh;
  32.  
  33. SORT sort;
  34.  
  35. DIFF diff;
  36.  
  37. MACRO_STACK macro_stack[MAX_KEYS];      /* small, simple stack for calls */
  38.  
  39. REGX_INFO regx;
  40.  
  41. REGX_INFO sas_regx;
  42.  
  43. NFA_TYPE nfa;
  44.  
  45. NFA_TYPE sas_nfa;
  46.  
  47.  
  48. #if defined( __UNIX__ )
  49. chtype tde_color_table[128];
  50. #endif
  51.  
  52.  
  53. /*
  54.  *   those who use special accented characters as part of normal character set
  55.  *     in text do not particularly care for a straight ASCII sort sequence.
  56.  *
  57.  *   this modified ASCII sorting sequence for special accent characters is
  58.  *     useful with Enlish, Esperanto, and French.
  59.  */
  60. SORT_ORDER sort_order = {
  61.                /* ignore case */
  62.    { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
  63.      '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
  64.      '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
  65.      '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f',
  66.      ' ', '!', '\"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',',
  67.      '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  68.      ':', ';', '<', '=', '>', '?',
  69.      '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
  70.      'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '[',
  71.      '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
  72.      'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
  73.      'x', 'y', 'z', '{', '|', '}', '~', '', 'c', 'u', 'e', 'a', 'a', 'a',
  74.      'a', 'c', 'e', 'e', 'e', 'i', 'i', 'i', 'a', 'a', 'e', 'a', 'a', 'o',
  75.      'o', 'o', 'u', 'u', 'y', 'o', 'u', '¢', '£', '¥', '₧', 'ƒ', 'a', 'i',
  76.      'o', 'u', 'n', 'n', 'ª', 'º', '¿', '⌐', '¬', '½', '¼', '¡', '«', '»',
  77.      '░', '▒', '▓', '│', '┤', '╡', '╢', '╖', '╕', '╣', '║', '╗', '╝', '╜',
  78.      '╛', '┐', '└', '┴', '┬', '├', '─', '┼', '╞', '╟', '╚', '╔', '╩', '╦',
  79.      '╠', '═', '╬', '╧', '╨', '╤', '╥', '╙', '╘', '╒', '╓', '╫', '╪', '┘',
  80.      '┌', '█', '▄', '▌', '▐', '▀', 'α', 'ß', 'Γ', 'π', 'Σ', 'σ', 'µ', 'τ',
  81.      'Φ', 'Θ', 'Ω', 'δ', '∞', 'φ', 'ε', '∩', '≡', '±', '≥', '≤', '⌠', '⌡',
  82.      '÷', '≈', '°', '∙', '·', '√', 'ⁿ', '²', '■', ' ' },
  83.                /* match case */
  84.    { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
  85.      '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
  86.      '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
  87.      '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f',
  88.      ' ', '!', '\"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',',
  89.      '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  90.      ':', ';', '<', '=', '>', '?',
  91.      '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
  92.      'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[',
  93.      '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
  94.      'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
  95.      'x', 'y', 'z', '{', '|', '}', '~', '', 'C', 'u', 'e', 'a', 'a', 'a',
  96.      'a', 'c', 'e', 'e', 'e', 'i', 'i', 'i', 'A', 'A', 'E', 'a', 'A', 'o',
  97.      'o', 'o', 'u', 'u', 'y', 'O', 'U', '¢', '£', '¥', '₧', 'ƒ', 'a', 'i',
  98.      'o', 'u', 'n', 'N', 'ª', 'º', '¿', '⌐', '¬', '½', '¼', '¡', '«', '»',
  99.      '░', '▒', '▓', '│', '┤', '╡', '╢', '╖', '╕', '╣', '║', '╗', '╝', '╜',
  100.      '╛', '┐', '└', '┴', '┬', '├', '─', '┼', '╞', '╟', '╚', '╔', '╩', '╦',
  101.      '╠', '═', '╬', '╧', '╨', '╤', '╥', '╙', '╘', '╒', '╓', '╫', '╪', '┘',
  102.      '┌', '█', '▄', '▌', '▐', '▀', 'α', 'ß', 'Γ', 'π', 'Σ', 'σ', 'µ', 'τ',
  103.      'Φ', 'Θ', 'Ω', 'δ', '∞', 'φ', 'ε', '∩', '≡', '±', '≥', '≤', '⌠', '⌡',
  104.      '÷', '≈', '°', '∙', '·', '√', 'ⁿ', '²', '■', ' ' },
  105. };
  106.  
  107.  
  108. mode_infos mode = {
  109.    "$ modes",           /* signature for mode structure, 8 chars */
  110.    0,                   /* initial color scheme */
  111.    FALSE,               /* sync mode? */
  112.    TRUE,                /* sync semaphore must be TRUE - DO NOT CHANGE */
  113.    FALSE,               /* macro recording mode must be FALSE - DO NOT CHANGE */
  114.    TRUE,                /* insert mode */
  115.    TRUE,                /* indent mode */
  116.    8,                   /* tab size */
  117.    8,                   /* tab size */
  118.    TRUE,                /* default smart tab mode */
  119.    FALSE,               /* inflate tabs? */
  120.    IGNORE,              /* sort case */
  121.    FALSE,               /* enhanced keyboard flag - set in console.c */
  122.    SMALL_INS,           /* default cursor size == small insert */
  123.    EOF_TEXT,            /* eof message  --  ** defined in letters.h **  */
  124.    FALSE,               /* default FALSE = do not write ^Z at end of file */
  125.    NATIVE,              /* default write <cr><lf> at eol */
  126.    TRUE,                /* default remove trailing space on edited lines */
  127.    FALSE,               /* default show eol character is off */
  128.    NO_WRAP,             /* default word wrap mode is off */
  129.    0,                   /* default left margin - add 1 to margins for display */
  130.    2,                   /* default paragraph begin */
  131.    71,                  /* default right margin */
  132.    FALSE,               /* default justify right margin */
  133.    FALSE,               /* format paragraph/text semaphore - DO NOT CHANGE */
  134.    UNDO_STACK_LEN,      /* number lines in undo buffer */
  135.    FALSE,               /* default backup mode */
  136.    TRUE,                /* default ruler mode */
  137.    MM_DD_YY,            /* default date style */
  138.    _12_HOUR             /* default time style */
  139. };
  140.  
  141.  
  142. /*
  143.  * Default color settings.  Incidentally, I'm color blind (mild red-green) and
  144.  * the default colors look fine to me, Frank.
  145.  */
  146. TDE_COLORS colour = {
  147.    "$colors",
  148.    { { HERC_REVERSE, HERC_NORMAL, HERC_UNDER, HERC_REVERSE, HERC_REVERSE,
  149.      HERC_HIGH, HERC_NORMAL, HERC_NORMAL, HERC_HIGH, HERC_HIGH, HERC_HIGH,
  150.      HERC_REVERSE, HERC_REVERSE, HERC_NORMAL },
  151.    { COLOR_HEAD, COLOR_TEXT, COLOR_DIRTY, COLOR_MODE, COLOR_BLOCK,
  152.      COLOR_MESSAGE, COLOR_HELP, COLOR_DIAG, COLOR_EOF, COLOR_CURL, COLOR_RULER,
  153.      COLOR_POINTER, COLOR_TEXT, COLOR_OVRS } }
  154. };
  155.  
  156.  
  157. /*
  158.  * do_it is an array of pointers to functions that return int with an argument
  159.  * that is a pointer to a window.  Is that right???
  160.  */
  161. int  (* (do_it[NUM_FUNCS]))( TDE_WIN * ) = {
  162.    insert_overwrite,                /*   regular text keys          0  */
  163.    get_help,                        /*   Help                       1  */
  164.    insert_newline,                  /*   Rturn                      2  */
  165.    next_line,                       /*   NextLine                   3  */
  166.    beg_next_line,                   /*   BegNextLine                4  */
  167.    move_down,                       /*   LineDown                   5  */
  168.    move_up,                         /*   LineUp                     6  */
  169.    move_right,                      /*   CharRight                  7  */
  170.    move_left,                       /*   CharLeft                   8  */
  171.    pan_right,                       /*   PanRight                   9  */
  172.    pan_left,                        /*   PanLeft                   10  */
  173.    word_right,                      /*   WordRight                 11  */
  174.    word_left,                       /*   WordLeft                  12  */
  175.    page_down,                       /*   ScreenDown                13  */
  176.    page_up,